package com.itheima.controller;

import com.itheima.pojo.OperateLogPageRequest;
import com.itheima.pojo.PageResponseResult;
import com.itheima.pojo.Result;
import com.itheima.service.OperateLogService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/log")
public class OperateLogController {

    @Autowired
    private OperateLogService operateLogService;

    /* 日志列表查询*/
    @GetMapping("/page")
    public Result queryOperateLog(OperateLogPageRequest operateLogPageRequest) {
        log.info("请求的查询的查询日志表的参数有：{}",operateLogPageRequest);
        PageResponseResult pageResponseResult = operateLogService.queryOperateLog(operateLogPageRequest);
        return Result.success(pageResponseResult);
    }

}
